package mvp.com.bbc.myfarm.ui.activity;

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.Window;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.hjm.bottomtabbar.BottomTabBar;

import mvp.com.bbc.myfarm.R;
import mvp.com.bbc.myfarm.ui.fragment.FramDyFragment;
import mvp.com.bbc.myfarm.ui.fragment.HomeFragment;
import mvp.com.bbc.myfarm.ui.fragment.MyFramFragment;
import mvp.com.bbc.myfarm.ui.fragment.SystemFragment;

/**
 * author by ${cbf} on 2017/12/28.
 * changbfa@163.com
 */

public class StartAcitity extends AppCompatActivity {

    private BottomTabBar bottomtabBar;
    private TextView tvLeft, tvRigth;
    private ImageView ivCenter;
    private EditText etTitle;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_start);
        bottomtabBar = (BottomTabBar) findViewById(R.id.bottomtabBar);
        tvLeft = (TextView) findViewById(R.id.title_left);
        ivCenter = (ImageView) findViewById(R.id.iv_title_center);
        tvRigth = (TextView) findViewById(R.id.tv_title_right);
        etTitle = (EditText) findViewById(R.id.et_title_center);
        bottomtabBar.init(getSupportFragmentManager())
                .setTabBarBackgroundColor(Color.WHITE)
                .setImgSize(50, 50)
                .setFontSize(12)
                .setTabPadding(4, 6, 10)
                .setChangeColor(getResources().getColor(R.color.gar_77), getResources().getColor(R.color.gar_99))
                .addTabItem("首页", getResources().getDrawable(R.drawable.ic_launcher), HomeFragment.class)
                .addTabItem("农夫动态", getResources().getDrawable(R.drawable.ic_launcher), FramDyFragment.class)
                .addTabItem("我的农场", R.drawable.ic_launcher, MyFramFragment.class)
                .addTabItem("系统", R.mipmap.ic_launcher, SystemFragment.class)
                .isShowDivider(true);
    }
}
